using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using WebForum.App_Data;
using BaseForum.Model;

namespace WebForum
{
    public partial class Search : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void LinkButton1_Click(object sender, EventArgs e)
        {
            GridViewRow row = (GridViewRow)(((LinkButton)sender).NamingContainer);
            HiddenField hiddenField = (HiddenField)row.FindControl("HiddenFieldID");
            Int32 dID = Common.ParseInt32(hiddenField.Value);
            Doctor doctor = DoctorDataSource.Get(dID);

            if (doctor.PrivateInfo == false)
            {
                PanelInfo.Visible = true;
                LabelName.Text = doctor.Name;
                LabelAge.Text = doctor.Age.ToString();
                LabelLocaltion.Text = doctor.Location;
                LabelEmail.Text = doctor.Email;
                LabelWorkplace.Text = doctor.Workplace;
                LabelSpecialization.Text = doctor.Specialization;
                LabelExperience.Text = doctor.Experience;
                LabelAchievement.Text = doctor.Achievement;
            }
            else
            {
                PanelInfo.Visible = false;
                Common.Show("Doctor info not public!", Request.UrlReferrer.ToString());
            }
        }
    }
}
